# file = open('E:\\file_demo.txt',mode='r',encoding='utf-8')
# print(file)
# print(file.read())
# file.close()


# with open('E:\\file_demo.txt',mode='r',encoding='utf-8') as file:
#     print(file)
#     print(file.read())
#     file.close()
#
# with open('E:\\file_demo.txt',mode='a',encoding='utf-8') as file1:
#     # print(file1)
#     # print(file.read())
#     file1.write("\nwrite...write....write")
#     file1.writelines(['\na','\nb','\nc'])
#     file1.close()

# with open('E:\\file_demo.txt',mode='r',encoding='utf-8') as file2:
#     print(file2)
#     # print(file2.read())
#     # print(file2.readline())
#     print(file2.readlines())
#     file2.close()

# with open('E:\\file_demo.txt',mode='r',encoding='utf-8') as file3:
#     print(file3)
#     print(file3.tell())
#     print(file3.readline())
#     print(file3.tell())
#     file3.close()

with open('E:\\file_demo.txt',mode='a',encoding='utf-8') as file4:
    print(file4)
    print(file4.tell())
    # print(file4.readline())
    file4.seek(3,0)
    file4.write("01")
    print(file4.tell())
    file4.close()

with open('E:\\file_demo.txt',mode='r',encoding='utf-8') as file5:
    print(file5)
    print(file5.read())
    file5.close()